<!DOCTYPE html>
<html>
   <head>
      <script type = "text/javascript" src = "https://d3js.org/d3.v4.min.js"></script>
   </head>
   <body>
      <h3>Simple transitions</h3>
      <script>
        d3.select("body").transition()
            .style("background-color", "#FFFFFF")
            .style("background-color", "#000000")
            .duration(1000);

        d3.selectAll("h3").transition()
            .style("font-size","48px")
            .style("color","green")
            // 停止500ms
            .delay(500)
            // 动画1000ms
            .duration(1000);
      </script>
   </body>
</html>